package com.example.common.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.common.system.dao.RoleDao;
import com.example.common.system.entity.RoleEntity;
import com.example.common.system.service.RoleService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.common.util.PageUtils;



@Service("roleService")
public class RoleServiceImpl extends ServiceImpl<RoleDao, RoleEntity> implements RoleService {

    @Override
    public PageUtils queryPage(Page<RoleEntity> page, RoleEntity roleEntity) {
        IPage<RoleEntity> result = this.page(page, new QueryWrapper<RoleEntity>(roleEntity));

        return new PageUtils(result.getRecords(),
                result.getTotal(),
                result.getSize(),
                result.getPages());
    }

}